/* admin.css - 管理员后台通用样式 */

/* 基础样式 */
body {
    font-family: 'Arial', sans-serif;
    margin: 0;
    padding: 0;
    background-color: #f5f5f5;
    color: #333;
    line-height: 1.6;
}

/* 布局容器 */
.container {
    width: 95%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

.user-info{
    text-align: right;
}

/* 表格样式 */
table {
    width: 100%;
    border-collapse: collapse;
    margin: 20px 0;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
    background: #fff;
}

table th {
    background-color: #3498db;
    color: white;
    padding: 12px 15px;
    text-align: left;
}

table td {
    padding: 10px 15px;
    border-bottom: 1px solid #e0e0e0;
}

table tr:nth-child(even) {
    background-color: #f9f9f9;
}

table tr:hover {
    background-color: #f1f1f1;
}

/* 表单样式 */
form {
    margin: 20px 0;
    background: #fff;
    padding: 20px;
    border-radius: 5px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

input[type="text"],
input[type="password"],
input[type="number"],
input[type="email"],
select,
textarea {
    width: 100%;
    padding: 10px;
    margin: 8px 0;
    border: 1px solid #ddd;
    border-radius: 4px;
    box-sizing: border-box;
}

input[type="submit"],
input[type="button"],
button {
    background-color: #3498db;
    color: white;
    padding: 10px 15px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    margin-right: 10px;
}

input[type="submit"]:hover,
input[type="button"]:hover,
button:hover {
    background-color: #2980b9;
}

/* 导航菜单 */
.sidebar {
    background: #2c3e50;
    color: white;
    padding: 20px;
    width: 20%;
    float: left;
}

.sidebar a {
    color: white;
    text-decoration: none;
    display: block;
    padding: 10px;
    margin: 5px 0;
    border-radius: 4px;
}

.sidebar a:hover {
    background-color: #34495e;
}

/* 内容区域 */
.content {
    width: 79%;
    padding: 20px;
    background: #fff;
    border-radius: 5px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

/* 标题样式 */
h1, h2, h3 {
    color: #2c3e50;
    margin-top: 0;
}

h1 {
    border-bottom: 2px solid #3498db;
    padding-bottom: 10px;
}

/* 分页样式 */
.pagination {
    margin: 20px 0;
    text-align: center;
}

.pagination a, .pagination span {
    padding: 8px 12px;
    margin: 0 5px;
    border: 1px solid #ddd;
    border-radius: 4px;
    text-decoration: none;
    color: #3498db;
}

.pagination a:hover {
    background-color: #f5f5f5;
}

.pagination .current {
    background-color: #3498db;
    color: white;
    border-color: #3498db;
}

/* 图片样式 */
.product-image {
    max-width: 100px;
    max-height: 100px;
    display: block;
    margin: 0 auto;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .sidebar {
        width: 100%;
        float: none;
    }
    
    .content {
        margin-left: 0;
    }
}

/* 添加以下内容到 admin.css */

/* 订单管理特定样式 */
.order-management {
    background: #fff;
    padding: 20px;
    border-radius: 5px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.search-form {
    margin-bottom: 20px;
    padding: 15px;
    background: #f9f9f9;
    border-radius: 5px;
}

.form-group {
    display: flex;
    align-items: center;
    gap: 10px;
}

.form-group label {
    font-weight: bold;
    min-width: 100px;
}

.order-table {
    margin-top: 20px;
}

.order-table th {
    background-color: #2c3e50;
}

.status-未付款 {
    color: #e74c3c;
    font-weight: bold;
}

.status-已付款 {
    color: #f39c12;
    font-weight: bold;
}

.status-已发货 {
    color: #3498db;
    font-weight: bold;
}

.status-已完成 {
    color: #27ae60;
    font-weight: bold;
}

.actions {
    display: flex;
    gap: 5px;
    flex-wrap: wrap;
    align-items: center; /* 新增：垂直居中 */
}

.actions a {
    padding: 5px 10px;
    font-size: 0.9em;
    border-radius: 3px;
    white-space: nowrap;
    display: inline-flex; /* 可选：确保链接内容也能垂直居中 */
    align-items: center; /* 可选：确保链接内部内容垂直居中 */
}

.btn-detail {
    background-color: #3498db;
    color: white;
}

.btn-update {
    background-color: #f39c12;
    color: white;
}

.btn-delete {
    background-color: #e74c3c;
    color: white;
}

/* 订单详情样式 */
.order-detail {
    background: #fff;
    padding: 20px;
    border-radius: 5px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.order-info {
    background: #f9f9f9;
    padding: 15px;
    border-radius: 5px;
    margin-bottom: 20px;
}

.info-row {
    display: flex;
    margin-bottom: 10px;
}

.info-label {
    font-weight: bold;
    min-width: 120px;
}

.info-value {
    flex-grow: 1;
}

.price {
    color: #e74c3c;
    font-weight: bold;
    font-size: 1.2em;
}

.product-thumbnail {
    max-width: 60px;
    max-height: 60px;
    display: block;
    margin: 0 auto;
}

.action-buttons {
    margin-top: 20px;
    text-align: right;
}

.btn-back {
    display: inline-block;
    padding: 8px 15px;
    background-color: #95a5a6;
    color: white;
    text-decoration: none;
    border-radius: 4px;
}

.btn-back:hover {
    background-color: #7f8c8d;
}

/* 新增或修改以下样式 */

/* 主容器布局 */
.main-content {
    display: flex;
    min-height: calc(100vh - 150px); /* 减去顶部高度 */
}

/* 侧边栏样式 */
.sidebar {
    width: 250px;
    background: #2c3e50;
    color: white;
    padding: 20px 0;
    flex-shrink: 0; /* 防止侧边栏收缩 */
    height: 100%; /* 与内容区同高 */
}

.menu-title {
    font-weight: bold;
    padding: 10px 15px;
    margin: 15px 0 5px;
    color: #ecf0f1;
    border-bottom: 1px solid #34495e;
}

.sidebar a {
    color: #ecf0f1;
    text-decoration: none;
    display: block;
    padding: 10px 20px;
    margin: 5px 0;
    transition: all 0.3s;
    border-left: 3px solid transparent;
}

.sidebar a:hover {
    background-color: #34495e;
    border-left: 3px solid #3498db;
}

/* 内容区域样式 */
.content {
    flex-grow: 1;
    padding: 20px;
    background: #fff;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
    min-height: 100%; /* 与侧边栏同高 */
}

/* 表单样式优化 */
.form-container {
    max-width: 800px;
    margin: 0 auto;
    padding: 20px;
    background: #fff;
    border-radius: 5px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: bold;
    color: #2c3e50;
}

.form-control {
    width: 100%;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
}

/* 图片选择器样式 */
.image-selector {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-top: 10px;
}

.image-selector select {
    flex-grow: 1;
}

.image-preview {
    width: 100px;
    height: 100px;
    border: 1px dashed #ddd;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f9f9f9;
}

.image-preview img {
    max-width: 100%;
    max-height: 100%;
}

/* 按钮样式 */
.btn {
    display: inline-block;
    padding: 10px 20px;
    background: #3498db;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    transition: background 0.3s;
}

.btn:hover {
    background: #2980b9;
}

.btn-submit {
    background: #27ae60;
}

.btn-submit:hover {
    background: #219653;
}

/* admin.css - 商品管理页面特定样式 */

/* 商品管理容器 */
.product-management {
    padding: 20px;
    background: #fff;
    border-radius: 4px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

/* 搜索表单样式 */
.search-form {
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.search-form input[type="text"] {
    width: 300px;
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
}

.search-form button[type="submit"] {
    padding: 8px 15px;
    background: #3498db;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
}

/* 新增商品按钮 */
.btn-add {
    padding: 8px 15px;
    background: #27ae60;
    color: white;
    text-decoration: none;
    border-radius: 4px;
    margin-left: auto;
    font-size: 14px;
}

/* 商品表格样式 */
.product-table-container {
    overflow-x: auto;
}

.product-table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 20px;
    font-size: 14px;
}

.product-table th {
    background: #f8f9fa;
    padding: 12px 15px;
    text-align: left;
    font-weight: 500;
    border-bottom: 2px solid #eee;
    color: #333;
}

.product-table td {
    padding: 12px 15px;
    border-bottom: 1px solid #eee;
    vertical-align: middle;
}

/* 商品图片 */
.product-thumb {
    width: 80px;
    height: 80px;
    object-fit: cover;
    border-radius: 4px;
    display: block;
    margin: 0 auto;
}

.no-image {
    color: #999;
    font-size: 12px;
    display: block;
    text-align: center;
}

/* 商品名称 */
.product-name {
    font-weight: 500;
    color: #333;
}

/* 价格对齐 */
.text-right {
    text-align: right;
}

/* 操作按钮 */
.actions {
    display: flex;
    gap: 5px;
}

.actions a {
    padding: 6px 12px;
    border-radius: 3px;
    font-size: 12px;
    text-decoration: none;
    transition: all 0.2s;
}

.btn-edit {
    background: #3498db;
    color: white;
}

.btn-delete {
    background: #e74c3c;
    color: white;
}

.btn-detail {
    background: #95a5a6;
    color: white;
}

.actions a:hover {
    opacity: 0.8;
}

/* 分页样式 */
.pagination-wrapper {
    text-align: center;
    margin-top: 20px;
}

.pagination {
    display: inline-flex;
    gap: 5px;
}

.pagination li {
    list-style: none;
}

.pagination a, 
.pagination span {
    display: inline-block;
    padding: 6px 12px;
    border: 1px solid #ddd;
    border-radius: 3px;
    text-decoration: none;
    color: #3498db;
}

.pagination .active span {
    background: #3498db;
    color: white;
    border-color: #3498db;
}

.pagination a:hover {
    background-color: #f5f5f5;
}

/* 添加到admin.css中的新增样式 */

/* 表单容器样式优化 */
.form-container {
    max-width: 800px;
    margin: 20px auto;
    padding: 25px;
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
}

.form-container h2 {
    color: #2c3e50;
    margin-bottom: 25px;
    padding-bottom: 10px;
    border-bottom: 1px solid #eee;
    text-align: center;
}

/* 表单组样式优化 */
.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: #555;
    font-size: 14px;
}

/* 输入控件样式优化 */
.form-control {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #e0e0e0;
    border-radius: 4px;
    font-size: 14px;
    transition: border-color 0.3s;
    background-color: #fafafa;
}

.form-control:focus {
    border-color: #3498db;
    background-color: #fff;
    outline: none;
    box-shadow: 0 0 0 2px rgba(52,152,219,0.1);
}

/* 图片选择器样式优化 */
.image-selector {
    display: flex;
    align-items: center;
    gap: 15px;
}

.image-preview {
    width: 100px;
    height: 100px;
    border: 1px dashed #ddd;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f9f9f9;
    border-radius: 4px;
    overflow: hidden;
}

.image-preview img {
    max-width: 100%;
    max-height: 100%;
    display: none;
}

#no-image {
    color: #999;
    font-size: 12px;
}

/* 按钮样式优化 */
.btn-submit {
    width: 100%;
    padding: 12px;
    background: #27ae60;
    color: white;
    border: none;
    border-radius: 4px;
    font-size: 16px;
    cursor: pointer;
    transition: background 0.3s;
    margin-top: 10px;
}

.btn-submit:hover {
    background: #219653;
}

/* 下拉选择框样式优化 */
select.form-control {
    appearance: none;
    background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6 9 12 15 18 9'%3e%3c/polyline%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right 10px center;
    background-size: 16px;
    padding-right: 30px;
}

/* 文本区域样式优化 */
textarea.form-control {
    min-height: 80px;
    resize: vertical;
}

/* 响应式调整 */
@media (max-width: 768px) {
    .form-container {
        padding: 15px;
    }
    
    .image-selector {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .image-preview {
        margin-top: 10px;
    }
}

/* 添加到admin.css中的商品修改表单样式 */

/* 表单容器样式 */
#form1 {
    max-width: 900px;
    margin: 20px auto;
    padding: 25px;
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 15px rgba(0,0,0,0.05);
}

#form1 h2 {
    color: #2c3e50;
    margin: 0 0 25px 0;
    padding-bottom: 10px;
    border-bottom: 1px solid #f0f0f0;
    text-align: center;
    font-size: 22px;
}

/* 表格样式优化 */
#form1 table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0 15px;
}

#form1 table tr td:first-child {
    width: 120px;
    font-weight: 500;
    color: #555;
    vertical-align: top;
    padding-top: 12px;
}

/* 输入控件样式 */
#form1 input[type="text"],
#form1 textarea,
#form1 select {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #e0e0e0;
    border-radius: 4px;
    font-size: 14px;
    transition: all 0.3s;
    background-color: #fafafa;
}

#form1 input[type="text"]:focus,
#form1 textarea:focus,
#form1 select:focus {
    border-color: #3498db;
    background-color: #fff;
    box-shadow: 0 0 0 2px rgba(52,152,219,0.1);
    outline: none;
}

/* 图片选择区域 */
#form1 select#pImg {
    margin-bottom: 10px;
}

#form1 img#img1 {
    border: 1px solid #eee;
    border-radius: 4px;
    background: #f9f9f9;
    display: block;
    margin-top: 8px;
}

/* 必填标记 */
#form1 font[color="red"] {
    color: #e74c3c;
    margin-left: 5px;
}

/* 文本区域 */
#form1 textarea {
    min-height: 80px;
    resize: vertical;
}

/* 提交按钮 */
#form1 input[type="submit"] {
    display: block;
    width: 200px;
    margin: 30px auto 0;
    padding: 12px;
    background: #3498db;
    color: white;
    border: none;
    border-radius: 4px;
    font-size: 16px;
    cursor: pointer;
    transition: background 0.3s;
}

#form1 input[type="submit"]:hover {
    background: #2980b9;
}

/* 下拉选择框箭头 */
#form1 select {
    appearance: none;
    background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6 9 12 15 18 9'%3e%3c/polyline%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right 10px center;
    background-size: 14px;
    padding-right: 30px;
}

/* 响应式调整 */
@media (max-width: 768px) {
    #form1 {
        padding: 15px;
    }
    
    #form1 table tr td:first-child {
        width: 100%;
        display: block;
        padding-bottom: 5px;
    }
    
    #form1 table tr td {
        display: block;
        width: 100%;
    }
    
    #form1 input[type="submit"] {
        width: 100%;
    }
    
    #pDescrDetail {
        width: 100% !important;
    }
}